export default {
	namespaced: true,
	state: {
		id: '',
		name: '',
		avatar: ''
	},
	mutations: {
		setUser(state, v) {
			state.id = v.id
			state.avatar = v.avatar
			state.name = v.name
			localStorage.setItem('user', JSON.stringify(v))
		},
		clearUser(state, v) {
			state.id = ''
			state.avatar = ''
			state.name = ''
			localStorage.removeItem('user')
		}
	}
}
